﻿using System;

namespace Graphe.Collations.Commands
{
    public class EditManuscriptCommand : Command
    {
        #region Constructor

        public EditManuscriptCommand(string symbol, string signifier, Manuscript manuscript)
        {
            _symbol = symbol;
            _signifier = signifier;
            _manuscript = manuscript;
        }

        #endregion
        #region Private Instance Fields

        private string _symbol;
        private string _signifier;
        private string _oldSymbol;
        private string _oldSignifier;
        private Manuscript _manuscript;

        #endregion

        public override void Execute()
        {
            _oldSymbol = _manuscript.Symbol;
            _oldSignifier = _manuscript.Signifier;

            _manuscript.Symbol = _symbol;
            _manuscript.Signifier = _signifier;
        }

        public override void Undo()
        {
            _manuscript.Symbol = _oldSymbol;
            _manuscript.Signifier = _oldSignifier;
        }
    }
}
